package com.jk.smartelderlycare.controller;

import com.jk.smartelderlycare.dto.SysRole;
import com.jk.smartelderlycare.interfaces.SysRoleServiceApi;
import com.jk.smartelderlycare.pojo.PagedResponse;
import com.jk.smartelderlycare.service.SysRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hhk
 * @version 1.0
 * @ClassName SysRoleController
 * @program: smart-elderly-care
 * @description: TODO
 * @date 2024/11/7 11:39
 */
@Slf4j
@RestController
public class SysRoleController implements SysRoleServiceApi{
    @Autowired
    private SysRoleService sysRoleService;
    /**
     * @description: 查询
     * @param: [sysRole]
     * @return: java.util.List<com.jk.smartelderlycare.dto.SysRole>
     * @author hhk
     * @date: 2024/11/7 11:43
     */
    @Override
    public PagedResponse<SysRole> findSysSysRolePaginationList(SysRole sysRole, Integer pageNum, Integer pageSize) {
        return sysRoleService.findSysSysRolePaginationList(sysRole,pageNum,pageSize);
    }

    /**
     * @description: 新增
     * @param: [sysRole]
     * @return: void
     * @author hhk
     * @date: 2024/11/7 11:44
     */
    @Override
    public void addSysRole(SysRole sysRole) {
        sysRoleService.addSysRole(sysRole);
    }
    /**
     * @description: 根据id删除一条数据
     * @param: [roleId]
     * @return: void
     * @author hhk
     * @date: 2024/11/7 11:44
     */
    @Override
    public void deleteSysRoleByRoleId(Long roleId) {
        sysRoleService.deleteSysRoleByRoleId(roleId);
    }
    /**
     * @description: 根据id回显一条数据
     * @param: [roleId]
     * @return: com.jk.smartelderlycare.dto.SysRole
     * @author hhk
     * @date: 2024/11/7 11:44
     */
    @Override
    public SysRole findSysRoleByRoleId(Long roleId) {
        return sysRoleService.findSysRoleByRoleId(roleId);
    }
    /**
     * @description: 修改角色列表
     * @param: [sysRole]
     * @return: void
     * @author hhk
     * @date: 2024/11/7 11:45
     */
    @Override
    public void updateSysRole(SysRole sysRole) {
        sysRoleService.updateSysRole(sysRole);
    }
    /**
     * @description: 状态修改
     * @param: [sysRole]
     * @return: void
     * @author hhk
     * @date: 2024/11/7 16:47
     */
    @Override
    public void updateStatusById(SysRole sysRole) {
        sysRoleService.updateStatusById(sysRole);
    }
}
